#!/usr/bin/python3
def hr():
    print("=" * 80)


def format_print(i, j):
    print("{0:<1}*{1:<1}={2:<5}".format(i, j, i * j), end="")


def indent():
    print(" " * 9, end="")


for i in range(1, 10):
    for j in range(1, 11 - i):
        format_print(i, j)
    print("")
hr()

for i in range(1, 10):
    for j in range(1, i + 1):
        format_print(i, j)
    print("")
hr()

for i in range(1, 10):
    for j in range(1, 10 - i):
        indent()
    for j in range(i, 0, -1):
        format_print(i, j)
    print("")
hr()

for i in range(9, 0, -1):
    for j in range(9, i, -1):
        indent()
    for j in range(i, 0, -1):
        format_print(i, j)
    print("")

hr()
i = 1
while i < 10:
    j = 1
    while j < 11 - i:
        format_print(i, j)
        j += 1
    print("")
    i += 1
hr()

i = 1
while i < 10:
    j = 1
    while j < i + 1:
        format_print(i, j)
        j += 1
    print("")
    i += 1
hr()

i = 1
while i < 10:
    j = 1
    while j < 10 - i:
        indent()
        j += 1
    j = i
    while j > 0:
        format_print(i, j)
        j -= 1
    print("")
    i += 1
hr()
i = 9
while i >= 0:
    j = 9
    while j > i:
        indent()
        j -= 1
    j = i
    while j > 0:
        format_print(i, j)
        j -= 1
    print("")
    i -= 1
